#include "stdafx.h"

#include <Windows.h>
#include <thread>
#include <future>

#include "CppUnitTest.h"

#include "..\..\FirefoxHandler\exports.h"
#include "..\..\FirefoxHandler\Errors.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace std;

namespace UnitNormalRun
{


    TEST_CLASS(MouseKeybdTest)
    {
        BEGIN_TEST_METHOD_ATTRIBUTE(mousekeybd_moveMouseTo)
            TEST_PRIORITY(6)
            END_TEST_METHOD_ATTRIBUTE();
        TEST_METHOD(mousekeybd_moveMouseTo)
        {
            {
                POINT targetP = { 0, 0 };
                fh_moveMouseTo(targetP.x, targetP.y);
                POINT p;
                ::GetCursorPos(&p);
                Assert::AreEqual(targetP.x, p.x);
                Assert::AreEqual(targetP.y, p.y);
            }
            {
                POINT targetP = { 100, 100 };
                fh_moveMouseTo(targetP.x, targetP.y);
                POINT p;
                ::GetCursorPos(&p);
                Assert::AreEqual(targetP.x, p.x);
                Assert::AreEqual(targetP.y, p.y);
            }
        }
    };
}